package com.example.demo.controller;import com.example.demo.model.Student;import com.example.demo.service.StudentService;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.web.bind.annotation.GetMapping;import org.springframework.web.bind.annotation.PostMapping;import org.springframework.web.bind.annotation.RequestBody;import org.springframework.web.bind.annotation.RestController;/** * @Author Sunjinxu * @Date: 2022/3/31 下午2:23 * @Version 1.0 * @Description TODO */@RestControllerpublic class StudentController {    @Autowired    StudentService studentService;    @PostMapping("/addStudent")    public int addStudent(@RequestBody Student student){        if(studentService.add(student) == 1){            System.out.println("添加成功");        }else {            System.out.println("添加失败");        }        return 0;    }}